package com.lineage.server.clientpackets;

import com.lineage.echo.ClientExecutor;
import com.lineage.server.model.Instance.L1NpcInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.world.WorldNpc;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class C_BoardBack extends ClientBasePacket {
  private static final Log _log = LogFactory.getLog(C_BoardBack.class);
  
  public void start(byte[] decrypt, ClientExecutor client) {
    try {
      read(decrypt);
      int objId = readD();
      int topicNumber = readD();
      L1NpcInstance npc = (L1NpcInstance)WorldNpc.get().map().get(Integer.valueOf(objId));
      if (npc == null)
        return; 
      L1PcInstance pc = client.getActiveChar();
      if (pc == null)
        return; 
      if (npc.ACTION != null)
        npc.ACTION.action(pc, npc, "n", topicNumber); 
    } catch (Exception exception) {
    
    } finally {
      over();
    } 
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
